package com.zh.test.longListener;

import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PropertiesLoaderUtils;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

/**
 * @Author zh
 * @Description  读取配置文件信息
 * @Date 2020/11/4
 * @Param
 * @return
 **/
public class propertiesReader {
    public static void main(String[] args) {
//        Resource classPathResource = new ClassPathResource("D:\\company\\lesu\\test.properties");
//        try {
//            Properties properties = PropertiesLoaderUtils.loadProperties(classPathResource);
//            String name = properties.getProperty("name");
//            System.out.println(name);
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
        File f = new File("D:\\company\\lesu\\test.properties");
        try {
            FileReader fileReader = new FileReader(f);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
}
